home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0035_Get name MINUS EXT.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  901b  |  25 lines

  1. {*****************************************************************************
  2.  * Function ...... GetName()
  3.  * Purpose ....... To return the file name (minus .EXT) from a path/mask
  4.  *                 string.
  5.  * Parameters .... Path         File path/mask to return the name from
  6.  * Returns ....... 8 character DOS file name without extension
  7.  * Notes ......... Uses functions Empty and Replicate
  8.  * Author ........ Martin Richardson
  9.  * Date .......... October 23, 1992
  10.  *****************************************************************************}
  11. FUNCTION GetName( Path : DirStr ): NameStr;
  12. VAR dir  : DirStr;
  13.     name : NameStr;
  14.     ext  : ExtStr;
  15. BEGIN
  16.      FSPLIT( path, dir, name, ext );
  17.      IF NOT Empty( Name ) THEN
  18.         GetName := Name
  19.      ELSE IF NOT Empty( Ext ) THEN
  20.         GetName := Ext
  21.      ELSE
  22.         GetName := Replicate( ' ', SIZEOF( Name ) );
  23. END;
  24.  
  25.